package com.sbr.seb.wicket.page;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.ChoiceRenderer;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

import com.sbr.seb.entity.checklist.Question;
import com.sbr.seb.entity.composants.Category;
import com.sbr.seb.rule.entity.PersistedService;

/**
 * Homepage
 */
public class AddCheckListQuestionPage extends BasePage {

	private static final long serialVersionUID = 1L;

	
	private String categoryName;
	
	
	
    /**
	 * Constructor that is invoked when page is invoked without a session.
	 * 
	 * @param parameters
	 *            Page parameters
	 */
    public AddCheckListQuestionPage() {
    	super();
    	
    	List<Category> categories = new ArrayList<Category>();
    	categories.add(new Category("Contrôles globaux", "Controles de la globalité"));
    	categories.add(new Category("Contrôles compilation", "Controles de la compilation"));
    	
    	
    	final TextField<Object> question = new RequiredTextField("question", new Model());
		final TextField<Object> defaultAnswer = new TextField("defaultAnswer", new Model());
		
		final DropDownChoice<Category> categoryBox = new DropDownChoice<Category>("categoryBox", new PropertyModel(this, "categoryName"), categories,  new ChoiceRenderer<Category>("name","id"));


		Form form = new Form("addCheckListQuestionForm") {

			@Override
			protected void onSubmit() {
			}
		};
		form.add(question);
		form.add(defaultAnswer);
		form.add(categoryBox);
		add(form);
		add(new FeedbackPanel("feedbackPanel"));
    }
}
